Integrand size = 32, antiderivative size = 138 \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=-4 a^3 (i A+B) x-\frac {4 a^3 (A-i B) \log (\cos (c+d x))}{d}+\frac {2 a^3 (i A+B) \tan (c+d x)}{d}+\frac {a (A-i B) (a+i a \tan (c+d x))^2}{2 d}+\frac {A (a+i a \tan (c+d x))^3}{3 d}-\frac {i B (a+i a \tan (c+d x))^4}{4 a d} \]
[Out]
Time = 0.15 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {3673, 3608, 3559, 3558, 3556} \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {2 a^3 (B+i A) \tan (c+d x)}{d}-\frac {4 a^3 (A-i B) \log (\cos (c+d x))}{d}-4 a^3 x (B+i A)+\frac {a (A-i B) (a+i a \tan (c+d x))^2}{2 d}+\frac {A (a+i a \tan (c+d x))^3}{3 d}-\frac {i B (a+i a \tan (c+d x))^4}{4 a d} \]
[In]
[Out]
Rule 3556
Rule 3558
Rule 3559
Rule 3608
Rule 3673
Rubi steps \begin{align*} \text {integral}& = -\frac {i B (a+i a \tan (c+d x))^4}{4 a d}+\int (a+i a \tan (c+d x))^3 (-B+A \tan (c+d x)) \, dx \\ & = \frac {A (a+i a \tan (c+d x))^3}{3 d}-\frac {i B (a+i a \tan (c+d x))^4}{4 a d}-(i A+B) \int (a+i a \tan (c+d x))^3 \, dx \\ & = \frac {a (A-i B) (a+i a \tan (c+d x))^2}{2 d}+\frac {A (a+i a \tan (c+d x))^3}{3 d}-\frac {i B (a+i a \tan (c+d x))^4}{4 a d}-(2 a (i A+B)) \int (a+i a \tan (c+d x))^2 \, dx \\ & = -4 a^3 (i A+B) x+\frac {2 a^3 (i A+B) \tan (c+d x)}{d}+\frac {a (A-i B) (a+i a \tan (c+d x))^2}{2 d}+\frac {A (a+i a \tan (c+d x))^3}{3 d}-\frac {i B (a+i a \tan (c+d x))^4}{4 a d}+\left (4 a^3 (A-i B)\right ) \int \tan (c+d x) \, dx \\ & = -4 a^3 (i A+B) x-\frac {4 a^3 (A-i B) \log (\cos (c+d x))}{d}+\frac {2 a^3 (i A+B) \tan (c+d x)}{d}+\frac {a (A-i B) (a+i a \tan (c+d x))^2}{2 d}+\frac {A (a+i a \tan (c+d x))^3}{3 d}-\frac {i B (a+i a \tan (c+d x))^4}{4 a d} \\ \end{align*}
Time = 1.02 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.76 \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {a^3 \left (4 A-3 i B+48 (A-i B) \log (i+\tan (c+d x))+48 (i A+B) \tan (c+d x)-6 (3 A-4 i B) \tan ^2(c+d x)-4 i (A-3 i B) \tan ^3(c+d x)-3 i B \tan ^4(c+d x)\right )}{12 d} \]
[In]
[Out]
Time = 0.10 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.89
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {i B \left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {i A \left (\tan ^{3}\left (d x +c \right )\right )}{3}+2 i B \left (\tan ^{2}\left (d x +c \right )\right )-B \left (\tan ^{3}\left (d x +c \right )\right )+4 i A \tan \left (d x +c \right )-\frac {3 A \left (\tan ^{2}\left (d x +c \right )\right )}{2}+4 B \tan \left (d x +c \right )+\frac {\left (-4 i B +4 A \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-4 i A -4 B \right ) \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) | \(123\) |
default | \(\frac {a^{3} \left (-\frac {i B \left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {i A \left (\tan ^{3}\left (d x +c \right )\right )}{3}+2 i B \left (\tan ^{2}\left (d x +c \right )\right )-B \left (\tan ^{3}\left (d x +c \right )\right )+4 i A \tan \left (d x +c \right )-\frac {3 A \left (\tan ^{2}\left (d x +c \right )\right )}{2}+4 B \tan \left (d x +c \right )+\frac {\left (-4 i B +4 A \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-4 i A -4 B \right ) \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) | \(123\) |
norman | \(\left (-4 i A \,a^{3}-4 B \,a^{3}\right ) x -\frac {\left (i A \,a^{3}+3 B \,a^{3}\right ) \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}-\frac {\left (-4 i B \,a^{3}+3 A \,a^{3}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {4 \left (i A \,a^{3}+B \,a^{3}\right ) \tan \left (d x +c \right )}{d}-\frac {i B \,a^{3} \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}+\frac {2 \left (-i B \,a^{3}+A \,a^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}\) | \(143\) |
parallelrisch | \(-\frac {3 i B \,a^{3} \left (\tan ^{4}\left (d x +c \right )\right )+4 i A \left (\tan ^{3}\left (d x +c \right )\right ) a^{3}+48 i A x \,a^{3} d -24 i B \left (\tan ^{2}\left (d x +c \right )\right ) a^{3}+12 B \left (\tan ^{3}\left (d x +c \right )\right ) a^{3}-48 i A \tan \left (d x +c \right ) a^{3}+18 A \left (\tan ^{2}\left (d x +c \right )\right ) a^{3}+24 i B \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{3}+48 B x \,a^{3} d -24 A \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{3}-48 B \tan \left (d x +c \right ) a^{3}}{12 d}\) | \(157\) |
risch | \(\frac {8 a^{3} B c}{d}+\frac {8 i a^{3} A c}{d}+\frac {2 i a^{3} \left (24 i A \,{\mathrm e}^{6 i \left (d x +c \right )}+36 B \,{\mathrm e}^{6 i \left (d x +c \right )}+57 i A \,{\mathrm e}^{4 i \left (d x +c \right )}+69 B \,{\mathrm e}^{4 i \left (d x +c \right )}+46 i A \,{\mathrm e}^{2 i \left (d x +c \right )}+54 B \,{\mathrm e}^{2 i \left (d x +c \right )}+13 i A +15 B \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {4 i a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B}{d}-\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) A}{d}\) | \(171\) |
parts | \(\frac {\left (-i A \,a^{3}-3 B \,a^{3}\right ) \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {\left (3 i A \,a^{3}+B \,a^{3}\right ) \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {\left (3 i B \,a^{3}-3 A \,a^{3}\right ) \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}+\frac {A \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{3}}{2 d}-\frac {i B \,a^{3} \left (\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}\) | \(185\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.64 \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=-\frac {2 \, {\left (12 \, {\left (2 \, A - 3 i \, B\right )} a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, {\left (19 \, A - 23 i \, B\right )} a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (23 \, A - 27 i \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (13 \, A - 15 i \, B\right )} a^{3} + 6 \, {\left ({\left (A - i \, B\right )} a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, {\left (A - i \, B\right )} a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, {\left (A - i \, B\right )} a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, {\left (A - i \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - i \, B\right )} a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 235 vs. \(2 (114) = 228\).
Time = 0.47 (sec) , antiderivative size = 235, normalized size of antiderivative = 1.70 \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=- \frac {4 a^{3} \left (A - i B\right ) \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 26 A a^{3} + 30 i B a^{3} + \left (- 92 A a^{3} e^{2 i c} + 108 i B a^{3} e^{2 i c}\right ) e^{2 i d x} + \left (- 114 A a^{3} e^{4 i c} + 138 i B a^{3} e^{4 i c}\right ) e^{4 i d x} + \left (- 48 A a^{3} e^{6 i c} + 72 i B a^{3} e^{6 i c}\right ) e^{6 i d x}}{3 d e^{8 i c} e^{8 i d x} + 12 d e^{6 i c} e^{6 i d x} + 18 d e^{4 i c} e^{4 i d x} + 12 d e^{2 i c} e^{2 i d x} + 3 d} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.83 \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=-\frac {3 i \, B a^{3} \tan \left (d x + c\right )^{4} + 4 \, {\left (i \, A + 3 \, B\right )} a^{3} \tan \left (d x + c\right )^{3} + 6 \, {\left (3 \, A - 4 i \, B\right )} a^{3} \tan \left (d x + c\right )^{2} + 48 \, {\left (d x + c\right )} {\left (i \, A + B\right )} a^{3} - 24 \, {\left (A - i \, B\right )} a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 48 \, {\left (-i \, A - B\right )} a^{3} \tan \left (d x + c\right )}{12 \, d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 408 vs. \(2 (116) = 232\).
Time = 0.53 (sec) , antiderivative size = 408, normalized size of antiderivative = 2.96 \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=-\frac {2 \, {\left (6 \, A a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 6 i \, B a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, A a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 24 i \, B a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 36 \, A a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 36 i \, B a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, A a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 24 i \, B a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, A a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} - 36 i \, B a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 57 \, A a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} - 69 i \, B a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 46 \, A a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - 54 i \, B a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, A a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 6 i \, B a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 13 \, A a^{3} - 15 i \, B a^{3}\right )}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
[In]
[Out]
Time = 7.56 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.28 \[ \int \tan (c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {B\,a^3\,1{}\mathrm {i}}{2}-\frac {a^3\,\left (2\,A-B\,1{}\mathrm {i}\right )}{2}+\frac {a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (A\,a^3\,1{}\mathrm {i}+B\,a^3+a^3\,\left (2\,A-B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (\frac {B\,a^3}{3}+\frac {a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )}{3}\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (4\,A\,a^3-B\,a^3\,4{}\mathrm {i}\right )}{d}-\frac {B\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^4\,1{}\mathrm {i}}{4\,d} \]
[In]
[Out]